<template>
  <ych-modal
    :fullscreen="false"
    :title="title"
    :visible="visible"
    @cancel="handleCancel">
    <a-button-group>
      <a-button v-for="data in dataVoList" :key="data.id"
                @click="handleOk(data)">
        {{data.text || data.id}}
      </a-button>
    </a-button-group>
    <template slot="footer">
      <a-button key="close" @click="handleCancel">{{ $t('m.common.button.close') }}</a-button>
    </template>
  </ych-modal>
</template>

<script>
  export default {
    name: "BpmButtonCommonDialog",
    components: {},
    props: {
      dataVoList: {
        type: Array,
        default: () => []
      },
      title: {
        type: String,
        default: null
      }
    },
    data() {
      return {
        visible: false,
      }
    },
    methods: {
      handleOk(data) {
        this.$emit('selectOk', data);
        this.visible = false;
      },
      handleCancel() {
        this.visible = false;
      }
    }
  }
</script>
